package org.akaza.openclinica.domain.datamap;
// Generated Jul 31, 2013 2:03:33 PM by Hibernate Tools 3.4.0.CR1

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.akaza.openclinica.domain.AbstractMutableDomainObject;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * StudyParameterValue generated by hbm2java
 */
@Entity
@Table(name = "study_parameter_value")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class StudyParameterValue  extends AbstractMutableDomainObject {

	private StudyParameterValueId id;
	private Study study;
	private StudyParameter studyParameter;

	public StudyParameterValue() {
	}

	public StudyParameterValue(StudyParameterValueId id) {
		this.id = id;
	}

	public StudyParameterValue(StudyParameterValueId id, Study study,
			StudyParameter studyParameter) {
		this.id = id;
		this.study = study;
		this.studyParameter = studyParameter;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "studyParameterValueId", column = @Column(name = "study_parameter_value_id", nullable = false)),
			@AttributeOverride(name = "studyId", column = @Column(name = "study_id")),
			@AttributeOverride(name = "value", column = @Column(name = "value", length = 50)),
			@AttributeOverride(name = "parameter", column = @Column(name = "parameter")) })
	/*public Integer getId() {
		return this.id;
	}

	public void setId(StudyParameterValueId id) {
		this.id = id;
	}*/

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "study_id", insertable = false, updatable = false)
	public Study getStudy() {
		return this.study;
	}

	public void setStudy(Study study) {
		this.study = study;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parameter", insertable = false, updatable = false)
	public StudyParameter getStudyParameter() {
		return this.studyParameter;
	}

	public void setStudyParameter(StudyParameter studyParameter) {
		this.studyParameter = studyParameter;
	}

}
